Skip to content

Allow disabling remote method after initialize explorer - #157

Merged
superkhau merged 1 commit into
strongloop:masterfrom
supasate:feature/allow-disable-remote-method-after-init
May 1, 2016
Merged

Allow disabling remote method after initialize explorer#157
superkhau merged 1 commit into
strongloop:masterfrom
supasate:feature/allow-disable-remote-method-after-init

Conversation

@supasate

Copy link
Copy Markdown
Contributor

This PR is for strongloop/loopback#686 to make the explorer registering a remoteMethodDisabled event that is fired from PR strongloop/loopback#2266. The explorer will update a swagger object when getting this event to hide the disabled remote method.

@slnode

slnode commented Apr 27, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

Comment thread test/explorer.test.js Outdated
var paths = Object.keys(res.body.paths);
expect(paths).to.not.contain('/products/findOne');
});
done();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this done after the above expect.

expect(paths)...
done();

@superkhau

superkhau commented Apr 28, 2016

Copy link
Copy Markdown
Contributor

@supasate Two things to fix, otherwise LGTM.

Comment thread index.js Outdated

// listening to remoteMethodDisabled event for updating the swaggerObject
// when a remote method is disabled and remote it from the Swagger UI.
loopbackApplication.on('remoteMethodDisabled', function() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent comment to line up with loopbackApplication...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@superkhau It seems like this whole file uses this style of indentation. I'm not sure it's the convention or not, so, I just followed. Should I change the indentation of the whole file?

@superkhau superkhau Apr 29, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...it's probably the linter that messed up. I would appreciated if you could help fix it in a second commit (or another PR if you prefer). It is definitely not convention, it looks messed up all over the place lol.

@supasate
supasate force-pushed the feature/allow-disable-remote-method-after-init branch from 61c3167 to 3d34a65 Compare April 29, 2016 04:30
@supasate

Copy link
Copy Markdown
Contributor Author

@superkhau I've fixed them and squashed the commits.

Anyway, currently, I just use the loopback dependency directly from strongloop/loopback#2266. What version of loopback in package.json should be if it's not tagged as a new version yet?

@bajtos

bajtos commented Apr 29, 2016

Copy link
Copy Markdown
Member

The patch contains quite few unrelated indentation changes. I'd like to wait with landing it until #158 is landed first.

@bajtos

bajtos commented Apr 29, 2016

Copy link
Copy Markdown
Member

Hey @supasate, sorry for the trouble, could you please rebase your patch on top of the current master? git rebase master && git push -f.

@superkhau

Copy link
Copy Markdown
Contributor

The patch contains quite few unrelated indentation changes. I'd like to wait with landing it until #158 is landed first.

I ask him to do it in a separate commit (in one of the comments) so I can review it easier.

@supasate Please resolve the conflicts now that #158 has been merged and we'll get it merged in.

…ized

Signed-off-by: Supasate Choochaisri <supasate.c@gmail.com>
@supasate
supasate force-pushed the feature/allow-disable-remote-method-after-init branch from 3d34a65 to ff60f8b Compare April 29, 2016 21:10
@supasate

Copy link
Copy Markdown
Contributor Author

@bajtos @superkhau Should be alright now.

@superkhau

Copy link
Copy Markdown
Contributor

LGTM. Thanks for the contribution! ;)

@superkhau
superkhau merged commit 372f024 into strongloop:master May 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants